package zkk.com.mengqu.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import in.srain.cube.views.GridViewWithHeaderAndFooter;
import zkk.com.mengqu.R;
import zkk.com.mengqu.adapter.PrivateMenuAdapter;

/**
 * 私人菜谱页面
 */
public class PrivateMenuFragment extends Fragment{

    private  View view;
    private GridViewWithHeaderAndFooter gridViewWithHeaderAndFooter;
    private PrivateMenuAdapter privateMenuAdapter;
    private Context context;

//    Observer<GoodThemeBean> observer=new Observer<GoodThemeBean>() {
//        @Override
//        public void onCompleted() {
//
//        }
//
//        @Override
//        public void onError(Throwable e) {
//            Log.d("zkk---","错误-"+e);
//        }
//
//        @Override
//        public void onNext(GoodThemeBean result) {
//        }
//    };

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.fragment_private_menu,container,false);
        context=getParentFragment().getActivity();
        return view;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    private  void  init(){
        gridViewWithHeaderAndFooter=(GridViewWithHeaderAndFooter) view.findViewById(R.id.gv_super_gridview);
        privateMenuAdapter =new PrivateMenuAdapter(context);
        gridViewWithHeaderAndFooter.setAdapter(privateMenuAdapter);
    }
    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        init();
    }
}
